package operator.condition;

import io.reactivex.Observable;
import io.reactivex.functions.Predicate;
import util.RxJavaHelper;

class AnyOperator {

    public static void main(String[] args) {
        any();
    }


    /**
     * 验证每一个值，有一个true，则结果为true
     */
    static void any(){
        Observable.just(1, 2, 3)
                .any(new Predicate<Integer>() {
                    @Override
                    public boolean test(Integer integer) throws Exception {
                        return integer == 3;
                    }
                })
                .subscribe(RxJavaHelper.getSingleConsumer());
    }


}
